﻿namespace PlayMyLife.Definitions.HumanProperty {
    /// <summary>
    /// 姓名类型
    /// </summary>
    [System.Serializable]
    public enum NameType : byte {
        /// <summary> 只有名 </summary>
        RealOnly,
        /// <summary> 姓在名前 </summary>
        LastIsReal,
        /// <summary> 名在姓前 </summary>
        FirstIsReal
    }

    /// <summary>
    /// 姓名数据
    /// </summary>
    [System.Serializable]
    public class Name {
        /// <summary> 姓名格式 </summary>
        public NameType nameType;
        /// <summary> 姓 </summary>
        public string familyName;
        /// <summary> 名 </summary>
        public string realName;
        /// <summary> 姓名之间的间隔符 </summary>
        public string seq;

        public Name(string firstName, string lastName, NameType tp, string seq = " ") {
            nameType = tp;
            this.seq = seq;
            switch(tp) {
                case NameType.RealOnly:
                    familyName = "";
                    realName = firstName;
                    break;
                case NameType.FirstIsReal:
                    familyName = lastName;
                    realName = firstName;
                    break;
                case NameType.LastIsReal:
                    familyName = firstName;
                    realName = lastName;
                    break;
            }
        }

        public override string ToString() {
            return nameType switch {
                NameType.RealOnly => familyName,
                NameType.LastIsReal => familyName + seq + realName,
                NameType.FirstIsReal => realName + seq + familyName,
                _ => base.ToString(),
            };
        }

        public static implicit operator string(Name name) {
            return name.ToString();
        }
    }

    /// <summary>
    /// 性别
    /// </summary>
    [System.Serializable]
    public enum GenderType : byte {
        /// <summary> 未知 </summary>
        Unknown,
        /// <summary> 女性 </summary>
        Female,
        /// <summary> 男性 </summary>
        Male,
    }

    /// <summary>
    /// 人格类型，决定人的先天性格以及各项先天天赋
    /// </summary>
    [System.Serializable]
    public enum MbtiType : byte {
        Unknown,
        ESTP,
        ESFP,
        ISTJ,
        ISFJ,
        ENTP,
        ENFP,
        INTJ,
        INFJ,
        ESTJ,
        ESFJ,
        ISTP,
        ISFP,
        ENTJ,
        ENFJ,
        INTP,
        INFP,
        Special,
    }

    /// <summary>
    /// 一个人的先天固有属性，这些属性出生后无法更改
    /// </summary>
    [System.Serializable]
    public class HumanBaseProperty {
        /// <summary> 名字 </summary>
        public Name name;
        /// <summary> 性别 </summary>
        public GenderType gender;
        /// <summary> 生月 </summary>
        public int birthMonth;
        /// <summary> 生天 </summary>
        public int birthDay;
        /// <summary> 人格类型 </summary>
        public MbtiType mbti;
        /// <summary> 外在（颜值）魅力 </summary>
        public int beautyCharmValue;
        /// <summary> 内在（性格）魅力 </summary>
        public int sociatyCharmValue;
        /// <summary> 先天智力 </summary>
        public int intelligent;
    }
}
